add_executable(pingpongserver PingPongServer.cpp)
if(WIN32)
  target_link_libraries(pingpongserver ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(pingpongserver pthread brynet)
endif()

add_executable(pingpongclient PingPongClient.cpp)
if(WIN32)
  target_link_libraries(pingpongclient ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(pingpongclient pthread brynet)
endif()

add_executable(broadcastserver BroadCastServer.cpp)
if(WIN32)
  target_link_libraries(broadcastserver ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(broadcastserver pthread brynet)
endif()

add_executable(broadcastclient BroadCastClient.cpp)
if(WIN32)
  target_link_libraries(broadcastclient ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(broadcastclient pthread brynet)
endif()

add_executable(httpserver HttpServer.cpp)
if(WIN32)
  target_link_libraries(httpserver ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(httpserver pthread brynet)
  if(LIB_OPENSSL)
    target_link_libraries(httpserver ssl crypto)
  endif()
endif()

add_executable(httpclient HttpClient.cpp)
if(WIN32)
  target_link_libraries(httpclient ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(httpclient pthread brynet)
  if(LIB_OPENSSL)
    target_link_libraries(httpclient ssl crypto)
  endif()
endif()

add_executable(benchwebsocket BenchWebsocket.cpp)
if(WIN32)
  target_link_libraries(benchwebsocket ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(benchwebsocket pthread brynet)
endif()

add_executable(promisereceive PromiseReceive.cpp)
if(WIN32)
  target_link_libraries(promisereceive ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(promisereceive pthread brynet)
endif()

add_executable(webbinaryproxy WebBinaryProxy.cpp)
if(WIN32)
  target_link_libraries(webbinaryproxy ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(webbinaryproxy pthread brynet)
endif()